Truth
Prediction bebop cool swing
bebop 7 16 7
cool 13 3 2
swing 0 1 11
# A tibble: 3 x 3
.metric .estimator .estimate
<chr> <chr> <dbl>
1 accuracy multiclass 0.35
2 kap multiclass 0.0250
3 j_index macro 0.0250
# A tibble: 3 x 3
.metric .estimator .estimate
<chr> <chr> <dbl>
1 accuracy multiclass 0.433
2 kap multiclass 0.15
3 j_index macro 0.15
$bebop
35 x 1 sparse Matrix of class "dgCMatrix"
1
(Intercept) 1.23355163
danceability -0.72500762
energy 0.02010852
loudness .
speechiness 0.27278357
acousticness -2.98181583
instrumentalness 0.57407603
liveness -0.68043009
valence -0.47297944
tempo .
duration 0.63772641
C -0.24266215
`C#|Db` -1.20257047
D 1.49869262
`D#|Eb` -0.01880410
E 0.08156724
F .
`F#|Gb` .
G -0.12717689
`G#|Ab` 0.07015785
A .
`A#|Bb` 0.18655168
B -0.09989077
c01 0.01139399
c02 -0.69168107
c03 .
c04 .
c05 -0.02469010
c06 .
c07 .
c08 .
c09 .
c10 -1.23750344
c11 .
c12 .
$cool
35 x 1 sparse Matrix of class "dgCMatrix"
1
(Intercept) 0.64404797
danceability 0.63557350
energy -1.08474711
loudness 0.75954872
speechiness -0.23957521
acousticness .
instrumentalness .
liveness .
valence .
tempo -3.56146099
duration .
C 3.52095285
`C#|Db` .
D -0.09526093
`D#|Eb` .
E -0.17288050
F 0.38718182
`F#|Gb` -1.85983577
G 0.97143969
`G#|Ab` -0.10228430
A 0.04809570
`A#|Bb` -0.05866179
B 0.71124955
c01 -0.01623091
c02 0.24896315
c03 -2.48790997
c04 0.03999252
c05 0.07425531
c06 .
c07 1.22375465
c08 -0.05369686
c09 -0.41128897
c10 0.07909152
c11 -0.81164891
c12 -0.21367104
$swing
35 x 1 sparse Matrix of class "dgCMatrix"
1
(Intercept) -1.8775996
danceability .
energy .
loudness .
speechiness .
acousticness 0.4667213
instrumentalness -3.4989196
liveness 2.7798136
valence 2.0727824
tempo 0.9061818
duration -7.4935242
C .
`C#|Db` 1.3508418
D .
`D#|Eb` .
E .
F .
`F#|Gb` 0.5034063
G .
`G#|Ab` .
A -2.8387686
`A#|Bb` .
B .
c01 .
c02 .
c03 6.4364691
c04 -2.2334509
c05 .
c06 0.0256792
c07 -1.9287896
c08 .
c09 2.5792473
c10 .
c11 .
c12 4.2124158
# A tibble: 3 x 3
.metric .estimator .estimate
<chr> <chr> <dbl>
1 accuracy multiclass 0.483
2 kap multiclass 0.225
3 j_index macro 0.225
Call:
C5.0.default(x = x, y = y, trials = 1, control = C50::C5.0Control(minCases =
2, sample = 0))
C5.0 [Release 2.07 GPL Edition] Sun Mar 22 15:56:07 2020
-------------------------------
Class specified by attribute `outcome'
Read 60 cases (35 attributes) from undefined.data
Decision tree:
duration > -0.3803109: bebop (33/15)
duration <= -0.3803109:
:...energy <= -1.053609: cool (5/2)
energy > -1.053609: swing (22/2)
Evaluation on training data (60 cases):
Decision Tree
----------------
Size Errors
3 19(31.7%) <<
(a) (b) (c) <-classified as
---- ---- ----
18 2 (a): class bebop
15 3 2 (b): class cool
20 (c): class swing
Attribute usage:
100.00% duration
45.00% energy
Time: 0.0 secs
We’ve already gotten some hints on what features the playlists of my corpus are based, and thus what features Spotify considers distinctive for these jazz styles. If we run a confusion matrix for the first 20 tracks of all three lists, it turns out that swing is definitely the most distinctive one. Apparantly bebop and swing have a lot more in common according to spotify’s features. This is also something that previous plots suggested somewhat.
# A tibble: 3 x 3
.metric .estimator .estimate
<chr> <chr> <dbl>
1 accuracy multiclass 0.467
2 kap multiclass 0.2
3 j_index macro 0.2
The question now is what are the distinctive features? When I run the forest plot, the results differ but the distinctive features are always more or less duration, valence and timbre components, specifically number 2, 3, 6 and 12. Especially number 6 scores very high.
# A tibble: 3 x 3
.metric .estimator .estimate
<chr> <chr> <dbl>
1 accuracy multiclass 0.433
2 kap multiclass 0.15
3 j_index macro 0.150
When we rerun the confusion matrix, but with only the “important” features taken into account, there is barely any change in the results.
In these plots I showed the differences between the styles with the most distinctive features according to spotify. We see that indeed duration seems to be quite characteristic for the style of tunes.Also in valence we see quite the difference between swing and cool, while bebop is more spread out.The timbre components don’t seem to be that much of a big deal, except for component number 6. This is due a few heavy outliers!
I wanted to try to show some differences between harmony in cool jazz and previous styles. Although the harmonies of the cool era are similar to that of the previous styles, there are a few new trends, like more classical orientated harmony and also modal harmony. A lot of modal tunes consist of large sections of just one chord, instead of the more usual tonal progressions, and this is something I hoped to show with keygrams en chordograms. However I could not find examples that worked. Actually I couldn’t even find tracks where the key or a progression at any point was clear from the plot, even not in a “one chord tune” like Miles Davis’ So What. I think the reason for this is that jazz harmony is usually at least five-part. This means there five, six, or even seven independed harmonic voices from which the chords are built. This makes makes it really hard to detect the harmony especially with a walking bass. A solution for this could be to not only detect the pitch classes, but also show in what order the pitches are constructed. In jazz harmony the thirds and sevens are almost always voiced on the low side, as these make the basic harmonic progression clear, while the other voices, also reffered to as extensions, are used for coloring on top. This way the harmony is perfectly clear eventhough the chords have a lot of notes. I added some the examples of tracks that I tried to interpret. First to last are: Alone Together by Kenny Dorham, So What by Miles Davis and Take Five by the Dave Brubeck quartet.
For my portfolio I want to check out and compare playlists of different jazz genres, and see whether Spotify recognizes similar characteristic differences between the styles in their measured features as expected in these genres. The playlist I am going to use are the “sound of..” playlists. For this comparison it seems to me that the best styles to research are the most common and famous and big directions in jazz: swing, bebop, cool jazz. A difference to expect would for example be danceability between swing and cool jazz, as swing originated as dance music and later jazz changed more to a concert style of music. In order to do so I took the means of features that seemed relevant to see if there were any points of interest.
The comparison between cool jazz and swing does however give the expected results. Danceability, energy and valence are higher in swing, as one would expect it to be in dance music. Also there are less tunes with odd time signature in swing, which I’d say would also be more expected in dance music. I noticed however that one of the tunes that was listed as odd time signature tune in the bebop list was Take Five by the Dave Brubeck Quartet. I don’t think that Take Five could be classified as bebop tune in anyway, so this raises the question whether these list are made carefully enough and with what criteria the tunes are divided among the styles. ***
These two scatterplots visualize the findings from the first assignment. The differences between the styles are as expected, although the differences are not actually that big: swing is more danceable and has more valence than bebop and cooljazz and energy is lowest in cooljazz. A point of interest is that the scatterplot of energy and valence seems to suggest a positive correlation between the two. Although this is ofcourse not enough evidence, this could mean that Spotify uses one of these features to compute the other one. ***